package spring.boot.activiti.demo;

import org.activiti.engine.*;
import org.activiti.engine.form.FormProperty;
import org.activiti.engine.form.TaskFormData;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
/**
 * 1、部署流程
 * 2、启动流程实例
 * 3、请假人发出请假申请
 * 4、班主任查看任务
 * 5、班主任审批
 * 6、最终的教务处Boss审批

 */

 @RestController
@RequestMapping("/activiti")
public class DemoCotroller {
    public Logger log = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private RuntimeService runtimeService;
    @Autowired
    private TaskService taskService;
    @Autowired
    private FormService formService;

    @RequestMapping("/test")
    public String mq(){
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        processEngine.getRepositoryService()
                .createDeployment()
                .addClasspathResource("shenqing.bpmn")

                .addClasspathResource("shenqing.png")
                .deploy();
        return "ok";
    }

}
